package com.bw.BaseImage;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;

import com.bw.BaseImage.common.ImageLoaderType;
import com.bw.BaseImage.common.ImageOption;
import com.bw.BaseImage.impl.GlideImpl;
import com.bw.BaseImage.impl.PicassoImpl;

public class ImageLoader {
    private IImageLoader imageLoader;

    public ImageLoader(ImageLoaderType type){
        switch (type){
            case Glide:
                imageLoader = new GlideImpl();
                break;
            case Picasso:
                imageLoader = new PicassoImpl();
                break;
                case Cilo:
            default:
                imageLoader = new GlideImpl();
                break;
        }
    }

    public void loadImage(Context context, String url, ImageView view, ImageOption option){
        this.imageLoader.loadImage(context,url,view,option);
    }
    public void loadImage(Context context, Drawable drawable, ImageView view, ImageOption option){
        this.imageLoader.loadImage(context,drawable,view,option);
    }
    public void loadImage(Context context, Bitmap bitmap, ImageView view, ImageOption option){
        this.imageLoader.loadImage(context,bitmap,view,option);
    }
    public void loadImage(Context context, byte[] content, ImageView view, ImageOption option){
        this.imageLoader.loadImage(context,content,view,option);
    }



    public void loadImageCircle(Context context, String url, ImageView view, ImageOption option){
        this.imageLoader.loadImageCircle(context,url,view,option);
    }

    public void loadImageCircle(Context context, Drawable drawable, ImageView view, ImageOption option){
        this.imageLoader.loadImageCircle(context,drawable,view,option);
    }

    public void loadImageRouter(Context context, String url, ImageView view, ImageOption option,Integer radian){
        this.imageLoader.loadImageRouter(context,url,view,option,radian);
    }


}
